<template>
    <div>
        <CategorySelector :isForbiddenForm="state === 1"></CategorySelector>
        <SpuList v-if="state == 1" @setShowStatus="setShowStatus" @setCurrentSpu="setCurrentSpu"></SpuList>
        <SpuForm v-if="state == 2" @setShowStatus="setShowStatus" :currentSpu="currentSpu"></SpuForm>
        <SkuForm v-if="state == 3" @setShowStatus="setShowStatus" :currentSpu="currentSpu"></SkuForm>
    </div>
</template>

<script lang="ts">
import CategorySelector from '@/components/CategorySelector/index.vue'
import SpuList from './Component/SpuList.vue'
import SkuForm from './Component/SkuForm.vue'
import SpuForm from './Component/SpuForm.vue'
export default {
    name: 'Spu',
    components: { CategorySelector, SpuList, SkuForm, SpuForm }
}
</script>
<script lang="ts" setup>
import { ref } from 'vue'

const state = ref<number>(1)
const currentSpu = ref([])
// 跳转
const setShowStatus = (val: number) => {
    // console.log(val);
    state.value = val

}
// 传参
const setCurrentSpu = (val: any) => {
    // console.log('收到的数据', val);
    currentSpu.value = val

}
</script>


<style>
</style>